<?php

namespace app\api\controller;
use think\facade\Db;
use think\facade\Request;
use app\admin\controller\Admin;
class Common
{
    public function getHomeData()
    {
        $data = [];
        $data['total_order'] = Db::name('order')->count();
        $data['total_product'] = Db::name('goods')->count();
        $data['total_category'] = Db::name('category')->count();
        return json(['code' => 200,'msg' => '获取成功', 'data' => $data]);
    }
}